<div id="header">
  <div class="content border_bottom">
    <ul id="sub_nav">
      <li><a href="#" onclick="SetHome(this,window.location)" >设为首页</a></li>
      <li><a href="#" onclick="AddFavorite(window.location,document.title)" >加入收藏</a></li>
      <li class="nobg"><a href="#">联系我们</a></li>
    </ul>
    <img src="__TMPL__/images/logo.gif" alt="居然之家" name="logo" width="200" height="75" id="logo" />
    <img src="__TMPL__/images/adv-txt.gif" alt="" name="adv_txt" width="644" height="22" id="adv_txt" />
    <br class="clear" />
  </div>
  <div class="content dgreen-bg">
    <div class="content">
      <ul id="main_nav">
        <li><a href="#">主&nbsp;&nbsp;&nbsp;页</a></li>
        <li><a href="#">公司介绍</a></li>
        <li><a href="#">产品推荐</a></li>
        <li><a href="#">帮助中心</a></li>
        <li><a href="#">联系我们</a></li>
      </ul><br class="clear" />
    </div>
  </div>
</div>
<script>
  function SetHome(obj,vrl){
    try
    {
      obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
    }
    catch(e){
      if(window.netscape) {
        try {
          netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        }
        catch (e) {
          alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',vrl);
      }
    }
  }
  function AddFavorite(sURL, sTitle){
    try
    {
      window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
      try
      {
        window.sidebar.addPanel(sTitle, sURL, "");
      }
      catch (e)
      {
        alert("加入收藏失败，请使用Ctrl+D进行添加");
      }
    }
  }
</script>